const tray = new nw.Tray({ icon: 'icon.png', title: 'tray...' });
const menu = new nw.Menu();

const items = [
	{ title: 'title1', content: 'content1' },
	{ title: 'title2', content: 'content2' },
	{ title: 'title3', content: 'content3' }
];

items.forEach(({ title, content }) => {
	menu.append(new nw.MenuItem({ label: title, click: () => alert(content) }))
});

tray.menu = menu;